import { request } from '@/utils'

export async function getPermissions() {
    return await request({
        url: '/permission/',
        method: 'get',
    });
}

export async function addPermission(permission) {
    return await request({
        url: '/permission/',
        method: 'post',
        data: permission
    });
}

export async function updatePermission(permission) {
    return await request({
        url: '/permission/' + permission.id,
        method: 'put',
        data: permission
    });
}

export async function delPermission(id) {
    return await request({
        url: '/permission/' + id,
        method: 'delete',
    });
}

export async function clearPermission() {
    return await request({
        url: '/permission/',
        method: 'delete',
    });
}